package com.star.book.controller.system;

import com.star.book.entity.StarBook;
import com.star.book.entity.User;
import com.star.book.service.IStarBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
/**
 * 后台首页展示
 * */
@Controller
public class SysIndexController {
    @Autowired
    private IStarBookService starBookService;

    @GetMapping("/sys/")
    public String index(Model m){
        User user = SysUserInfo.loginInfo();
        m.addAttribute("user",user);
        StarBook starBook = starBookService.selectStarBookByTime();
        m.addAttribute("log",starBook);
        return "system/index";
    }


}
